package org.lisen.patterndemo.chain.v02;

import org.lisen.patterndemo.chain.Message;

public class WordFilter implements Filter {

    @Override
    public boolean doFilter(Message message) {

        String content = message.getContent();

        if(!content.contains("苍井空") && !content.contains("波多野结衣")) {
            return true;
        }

        content = content.replace("苍井空", "***");
        content = content.replace("波多野结衣", "*****");
        message.setContent(content);
        return false;
    }

}
